package cc.lj.internal.api.coupons.api.ticket;

import cc.lj.internal.api.core.config.FeignConfiguration;
import cc.lj.internal.api.coupons.api.ticket.fallbackfactory.CouponsSettlementFeignServiceFallbackFactory;
import cc.lj.internal.api.coupons.dto.CouponsSettlementApiDTO;
import cc.lj.internal.api.coupons.dto.command.CouponsSettlementApiCommand;
import cc.lj.internal.core.http.HttpResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 电子券分摊结算对外feign api
 * @author liangxifeng
 * @date 2022-01-13
 */
@FeignClient(contextId = "f-lj-internal-coupons-couponsSettlementFeignService",
        name = "lj-internal-coupons",
        //url = "http://192.168.15.110:8050", //后续如果使用nacos服务发现，则将改行去掉即可
        url = "${feign.couponsUrl}", //后续如果使用nacos服务发现，则将改行去掉即可
        path = "coupons",
        configuration = {FeignConfiguration.class},
        fallbackFactory = CouponsSettlementFeignServiceFallbackFactory.class
)
public interface CouponsSettlementFeignService {
    /**
     * 获取电子券分摊结算数据
     * @param couponsSettlementApiCommand
     * @return
     */
    @PostMapping("/getSettlementData")
    HttpResult<CouponsSettlementApiDTO> getSettlementData(@RequestBody CouponsSettlementApiCommand couponsSettlementApiCommand);
}
